import 'package:json_annotation/json_annotation.dart';

import '../home/product_detail_model.dart';

part 'cart_model.g.dart';


@JsonSerializable()
class CartModel extends Object {

  List<CartListModel>? cart_list;

  Total? total;

  int errcode;

  String message;

  CartModel(this.cart_list,this.total,this.errcode,this.message,);

  factory CartModel.fromJson(Map<String, dynamic> srcJson) => _$CartModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CartModelToJson(this);

}


@JsonSerializable()
class CartListModel extends Object {

  int shop_id;

  String shop_title;

  List<CartItemModel> carts;

  dynamic used_promotions;

  dynamic enableUsePromotion;

  dynamic gift;

  Total total;


  CartListModel(this.shop_id,this.shop_title,this.carts,this.used_promotions,this.enableUsePromotion,this.gift,this.total);

  factory CartListModel.fromJson(Map<String, dynamic> srcJson) => _$CartListModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CartListModelToJson(this);

}


@JsonSerializable()
class CartItemModel extends Object {

  int cart_id;

  int user_id;

  int product_id;

  String product_sn;

  String pic_thumb;

  String market_price;

  String original_price;

  int quantity;

  int sku_id;

  List<dynamic> sku_data;

  int product_type;

  bool is_checked;

  int shop_id;

  int type;

  int update_time;

  int salesman_id;

  String product_weight;

  int shipping_tpl_id;

  int free_shipping;

  int product_status;

  String product_name;

  String product_price;

  int category_id;

  int brand_id;

  int product_stock;

  int card_group_id;

  String virtual_sample;

  Shop? shop;

  int price;

  int member_discount;

  int stock;

  bool has_sku;

  String subtotal;

  int origin_price;

  bool is_disabled;

  Sku_list? sku;

  CartItemModel(this.cart_id,this.user_id,this.product_id,this.product_sn,this.pic_thumb,this.market_price,this.original_price,this.quantity,this.sku_id,this.sku_data,this.product_type,this.is_checked,this.shop_id,this.type,this.update_time,this.salesman_id,this.product_weight,this.shipping_tpl_id,this.free_shipping,this.product_status,this.product_name,this.product_price,this.category_id,this.brand_id,this.product_stock,this.card_group_id,this.virtual_sample,this.shop,this.price,this.member_discount,this.stock,this.has_sku,this.subtotal,this.origin_price,this.is_disabled,this.sku);

  factory CartItemModel.fromJson(Map<String, dynamic> srcJson) => _$CartItemModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CartItemModelToJson(this);

}


@JsonSerializable()
class Shop extends Object {

  String? status_text;

  int? shop_id;

  String? shop_title;

  String? shop_logo;

  Shop(this.status_text,this.shop_id,this.shop_title,this.shop_logo,);

  factory Shop.fromJson(Map<String, dynamic> srcJson) => _$ShopFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ShopToJson(this);

}


@JsonSerializable()
class Total extends Object {

  dynamic discount_coupon_amount;

  dynamic discount_seckill_amount;

  dynamic discount_time_discount_amount;

  dynamic discount_product_promotion_amount;

  dynamic discount_discount_amount;

  dynamic discounts;

  List<dynamic>? coupon_ids;

  num? product_amount;
  int? checked_count;
  num? discount_after;
  int? total_count;
  dynamic member_discount_amount;

  Total({this.discount_coupon_amount,this.product_amount,this.checked_count,this.discount_after,this.member_discount_amount,this.total_count
    ,this.discount_seckill_amount,this.discount_time_discount_amount,this.discount_product_promotion_amount,this.discount_discount_amount,this.discounts,this.coupon_ids});

  factory Total.fromJson(Map<String, dynamic> srcJson) => _$TotalFromJson(srcJson);

  Map<String, dynamic> toJson() => _$TotalToJson(this);

}




